package code.module.sound
{
	import com.yy.manager.ResourceManager;
	
	import flash.media.Sound;

	public class SoundManager
	{
		/**声音快关**/
		public static var SOUND_SWITCH:Boolean = true;		
		
		public static var ChipInSound:String = "ChipInSound";		
		public static var MoveToSeat:String = "MoveToSeat";		
		public static var Cow:String = "Cow";		
		public static var DealSound:String = "DealSound";		
		public static var DealSound2:String = "DealSound2";		
		public static var TimeSound:String = "TimeSound";		
		private static var _classKeys:Object = {
			ChipInSound:"sounds.ChipInSound",
			MoveToSeat:"sounds.MoveToSeat",
			Cow:"ui.sound.Cow",
			DealSound:"ui.sound.DealSound",
			DealSound2:"ui.sound.DealSound2",
			TimeSound:"sounds.ChipInSound"
		}
		public function SoundManager()
		{
		}
		
		/**
		 * 播放声音
		 * @param soundName
		 * 
		 */
		public static function playerSound(soundName:String):void {
			if(SOUND_SWITCH) {
				soundName = _classKeys[soundName];
				if(soundName) {
					var s:Sound = ResourceManager.getObjectByName(soundName) as Sound;
					if(s) {
						s.play();
					}else {
						trace("不能实例化对象：" + soundName);
					}
				}else {
					trace("未找到声音！");
				}
			}
		}
	}
}